/**
 */
package org.aphelie.chronicle.impl;

import org.aphelie.chronicle.ArcCategory;
import org.aphelie.chronicle.ArcElement;
import org.aphelie.chronicle.ArcItem;
import org.aphelie.chronicle.ArcMessageProvider;
import org.aphelie.chronicle.ArcScore;
import org.aphelie.chronicle.ArcShape;
import org.aphelie.chronicle.ArcSheet;
import org.aphelie.chronicle.ArcTopic;
import org.aphelie.chronicle.ArcTuple;
import org.aphelie.chronicle.ArcType;
import org.aphelie.chronicle.ChronicleFactory;
import org.aphelie.chronicle.ChroniclePackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class ChroniclePackageImpl extends EPackageImpl implements ChroniclePackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcScoreEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcCategoryEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcMessageProviderEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum arcTypeEEnum = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcTupleEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcItemEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcShapeEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcElementEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcSheetEClass = null;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass arcTopicEClass = null;
	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see org.aphelie.chronicle.ChroniclePackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private ChroniclePackageImpl() {
		super(eNS_URI, ChronicleFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link ChroniclePackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static ChroniclePackage init() {
		if (isInited) return (ChroniclePackage)EPackage.Registry.INSTANCE.getEPackage(ChroniclePackage.eNS_URI);

		// Obtain or create and register package
		ChroniclePackageImpl theChroniclePackage = (ChroniclePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ChroniclePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ChroniclePackageImpl());

		isInited = true;

		// Create package meta-data objects
		theChroniclePackage.createPackageContents();

		// Initialize created meta-data
		theChroniclePackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theChroniclePackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(ChroniclePackage.eNS_URI, theChroniclePackage);
		return theChroniclePackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcScore() {
		return arcScoreEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcScore_Value() {
		return (EAttribute)arcScoreEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcCategory() {
		return arcCategoryEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcMessageProvider() {
		return arcMessageProviderEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EOperation getArcMessageProvider__GetLabel__ArcElement() {
		return arcMessageProviderEClass.getEOperations().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getArcType() {
		return arcTypeEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcTuple() {
		return arcTupleEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getArcTuple_Scores() {
		return (EReference)arcTupleEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcTuple_Overall() {
		return (EAttribute)arcTupleEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcItem() {
		return arcItemEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcShape() {
		return arcShapeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcShape_Type() {
		return (EAttribute)arcShapeEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcShape_DefaultScore() {
		return (EAttribute)arcShapeEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getArcShape_Shapes() {
		return (EReference)arcShapeEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcShape_Optional() {
		return (EAttribute)arcShapeEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcShape_Refid() {
		return (EAttribute)arcShapeEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EOperation getArcShape__Shape__ArcSheet() {
		return arcShapeEClass.getEOperations().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EOperation getArcShape__Shape() {
		return arcShapeEClass.getEOperations().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcElement() {
		return arcElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcElement_Id() {
		return (EAttribute)arcElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EOperation getArcElement__GetLabel() {
		return arcElementEClass.getEOperations().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EOperation getArcElement__GetSheet() {
		return arcElementEClass.getEOperations().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcSheet() {
		return arcSheetEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getArcTopic() {
		return arcTopicEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getArcTopic_Topics() {
		return (EReference)arcTopicEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getArcTopic_Grade() {
		return (EAttribute)arcTopicEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ChronicleFactory getChronicleFactory() {
		return (ChronicleFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		arcElementEClass = createEClass(ARC_ELEMENT);
		createEAttribute(arcElementEClass, ARC_ELEMENT__ID);
		createEOperation(arcElementEClass, ARC_ELEMENT___GET_LABEL);
		createEOperation(arcElementEClass, ARC_ELEMENT___GET_SHEET);

		arcShapeEClass = createEClass(ARC_SHAPE);
		createEAttribute(arcShapeEClass, ARC_SHAPE__TYPE);
		createEAttribute(arcShapeEClass, ARC_SHAPE__DEFAULT_SCORE);
		createEReference(arcShapeEClass, ARC_SHAPE__SHAPES);
		createEAttribute(arcShapeEClass, ARC_SHAPE__OPTIONAL);
		createEAttribute(arcShapeEClass, ARC_SHAPE__REFID);
		createEOperation(arcShapeEClass, ARC_SHAPE___SHAPE__ARCSHEET);
		createEOperation(arcShapeEClass, ARC_SHAPE___SHAPE);

		arcSheetEClass = createEClass(ARC_SHEET);

		arcTopicEClass = createEClass(ARC_TOPIC);
		createEReference(arcTopicEClass, ARC_TOPIC__TOPICS);
		createEAttribute(arcTopicEClass, ARC_TOPIC__GRADE);

		arcTupleEClass = createEClass(ARC_TUPLE);
		createEReference(arcTupleEClass, ARC_TUPLE__SCORES);
		createEAttribute(arcTupleEClass, ARC_TUPLE__OVERALL);

		arcItemEClass = createEClass(ARC_ITEM);

		arcScoreEClass = createEClass(ARC_SCORE);
		createEAttribute(arcScoreEClass, ARC_SCORE__VALUE);

		arcCategoryEClass = createEClass(ARC_CATEGORY);

		arcMessageProviderEClass = createEClass(ARC_MESSAGE_PROVIDER);
		createEOperation(arcMessageProviderEClass, ARC_MESSAGE_PROVIDER___GET_LABEL__ARCELEMENT);

		// Create enums
		arcTypeEEnum = createEEnum(ARC_TYPE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		arcShapeEClass.getESuperTypes().add(this.getArcElement());
		arcSheetEClass.getESuperTypes().add(this.getArcTopic());
		arcSheetEClass.getESuperTypes().add(this.getArcMessageProvider());
		arcTopicEClass.getESuperTypes().add(this.getArcElement());
		arcTupleEClass.getESuperTypes().add(this.getArcCategory());
		arcItemEClass.getESuperTypes().add(this.getArcTopic());
		arcScoreEClass.getESuperTypes().add(this.getArcItem());
		arcCategoryEClass.getESuperTypes().add(this.getArcTopic());

		// Initialize classes, features, and operations; add parameters
		initEClass(arcElementEClass, ArcElement.class, "ArcElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getArcElement_Id(), ecorePackage.getEString(), "id", null, 1, 1, ArcElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEOperation(getArcElement__GetLabel(), ecorePackage.getEString(), "getLabel", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEOperation(getArcElement__GetSheet(), this.getArcSheet(), "getSheet", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(arcShapeEClass, ArcShape.class, "ArcShape", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getArcShape_Type(), this.getArcType(), "type", null, 0, 1, ArcShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getArcShape_DefaultScore(), ecorePackage.getEInt(), "defaultScore", "0", 0, 1, ArcShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getArcShape_Shapes(), this.getArcShape(), null, "shapes", null, 0, -1, ArcShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getArcShape_Optional(), ecorePackage.getEBoolean(), "optional", "false", 0, 1, ArcShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getArcShape_Refid(), ecorePackage.getEString(), "refid", null, 0, 1, ArcShape.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		EOperation op = initEOperation(getArcShape__Shape__ArcSheet(), this.getArcTopic(), "shape", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, this.getArcSheet(), "element", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEOperation(getArcShape__Shape(), this.getArcTopic(), "shape", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(arcSheetEClass, ArcSheet.class, "ArcSheet", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(arcTopicEClass, ArcTopic.class, "ArcTopic", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getArcTopic_Topics(), this.getArcTopic(), null, "topics", null, 0, -1, ArcTopic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getArcTopic_Grade(), ecorePackage.getEInt(), "grade", "-1", 0, 1, ArcTopic.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(arcTupleEClass, ArcTuple.class, "ArcTuple", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getArcTuple_Scores(), this.getArcScore(), null, "scores", null, 0, -1, ArcTuple.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getArcTuple_Overall(), ecorePackage.getEInt(), "overall", null, 0, 1, ArcTuple.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(arcItemEClass, ArcItem.class, "ArcItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(arcScoreEClass, ArcScore.class, "ArcScore", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getArcScore_Value(), ecorePackage.getEInt(), "value", null, 1, 1, ArcScore.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(arcCategoryEClass, ArcCategory.class, "ArcCategory", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(arcMessageProviderEClass, ArcMessageProvider.class, "ArcMessageProvider", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		op = initEOperation(getArcMessageProvider__GetLabel__ArcElement(), ecorePackage.getEString(), "getLabel", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, this.getArcElement(), "element", 1, 1, IS_UNIQUE, IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(arcTypeEEnum, ArcType.class, "ArcType");
		addEEnumLiteral(arcTypeEEnum, ArcType.TEXT);
		addEEnumLiteral(arcTypeEEnum, ArcType.SCORE);

		// Create resource
		createResource(eNS_URI);
	}

} //ChroniclePackageImpl
